From: Tim Starling Date: Tue, 26 Aug 2008 06:48:24 +0000 (+0000) Subject: Added __destruct(), for stable pseudo-branch X-Git-Tag: 1.31.0-rc.0~45661 X-Git-Url: http://git.cyclocoop.org/%28%5B%5E/404?a=commitdiff_plain;h=367607ae97ca6c078e9ad6a3e7c3e41a27c4566c;p=lhc%2Fweb%2Fwiklou.git Added __destruct(), for stable pseudo-branch --- diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 6e3b932a68..8bd9a03422 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -142,6 +142,15 @@ class Parser $this->mFirstCall = true; } + /** + * Reduce memory usage to reduce the impact of circular references + */ + function __destruct() { + foreach ( $this as $name => $value ) { + unset( $this->$name ); + } + } + /** * Do various kinds of initialisation on the first call of the parser */